package domain.entities;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

/**
 * Envios entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "envios", catalog = "bms")
public class Envios implements java.io.Serializable {

	// Fields

	private Integer id;
	private Safetydocs safetydocs;
    private String type;
    private String name;
    private String comment;
    private Date receivedBms;

    private String event;
    private Date revisionDate;
    private Date processedDate;
    private String controlNumber;
    private Date versionDate;
    private Date cutoffDate;
    private String replaceNumber;
    private Date replaceDate;

	// Constructors

	/** default constructor */
	public Envios() {
	}

	/** full constructor */
	public Envios(Safetydocs safetydocs) {
		this.safetydocs = safetydocs;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "comment")
    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @ManyToOne()
    @LazyCollection(LazyCollectionOption.FALSE)
    @JoinColumn(name = "SAFETYDOCSid", nullable = false)
	public Safetydocs getSafetydocs() {
		return this.safetydocs;
	}

	public void setSafetydocs(Safetydocs safetydocs) {
		this.safetydocs = safetydocs;
	}

    @Temporal(TemporalType.DATE)
    @Column(name = "receivedBms", length = 10)
    public Date getReceivedBms() {
        return this.receivedBms;
    }

    public void setReceivedBms(Date receivedBms) {
        this.receivedBms = receivedBms;
    }

    @Column(name = "event")
    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "revisionDate", length = 10)
    public Date getRevisionDate() {
        return revisionDate;
    }

    public void setRevisionDate(Date revisionDate) {
        this.revisionDate = revisionDate;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "processedDate", length = 10)
    public Date getProcessedDate() {
        return processedDate;
    }

    public void setProcessedDate(Date processedDate) {
        this.processedDate = processedDate;
    }

    @Column(name = "controlNumber")
    public String getControlNumber() {
        return controlNumber;
    }

    public void setControlNumber(String controlNumber) {
        this.controlNumber = controlNumber;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "versionDate", length = 10)
    public Date getVersionDate() {
        return versionDate;
    }

    public void setVersionDate(Date versionDate) {
        this.versionDate = versionDate;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "cutoffDate", length = 10)
    public Date getCutoffDate() {
        return cutoffDate;
    }

    public void setCutoffDate(Date cutoffDate) {
        this.cutoffDate = cutoffDate;
    }

    @Column(name = "replaceNumber")
    public String getReplaceNumber() {
        return replaceNumber;
    }

    public void setReplaceNumber(String replaceNumber) {
        this.replaceNumber = replaceNumber;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "replaceDate", length = 10)
    public Date getReplaceDate() {
        return replaceDate;
    }

    public void setReplaceDate(Date replaceDate) {
        this.replaceDate = replaceDate;
    }
}